package com.zys;

import org.junit.jupiter.api.Test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class jdbctext {
    @Test
    public void textUpdate() throws Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");
        String url = "jdbc:mysql://localhost:3306/web01";
        String username = "root";
        String password = "123456";
       Connection connection = DriverManager.getConnection(url,username,password);

       Statement statement = connection.createStatement();
       int i = statement.executeUpdate("update user set age='25' where id=1");
        System.out.println(i);
       statement.close();
       connection.close();
    }
}
